/**
 *  添加预付卡
 */

import 'package:cbec_app/components/base/base_page.dart';
import 'package:cbec_app/components/common/common_style.dart';
import 'package:cbec_app/components/base/base_nav_bar.dart';
import 'package:cbec_app/pages/my/controller/prepayment_card_ctr.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class AddPrepaymentCard extends GetView<PrePaymentCardController> {
  const AddPrepaymentCard({super.key});

  @override
  Widget build(BuildContext context) {
    return GetBuilder<PrePaymentCardController>(builder: (controller){
      return BasePage(
      title: "添加预付卡",
      iconType: IconType.back,
      children: [
        Container(
          margin: EdgeInsets.only(left: 18.w, top: 10.w, bottom: 10.w),
          child: const Text("预付卡卡号"),
        ),
        Container(
          margin: EdgeInsets.only(left: 18.w,right: 18.w,bottom: 10.w),
          padding: EdgeInsets.only(left: 20.w,top: 10.w),
          color: Colors.white,
          height: 40.h,
          child: TextFormField(
            decoration: descript("请输入预付卡卡号"),
            controller: controller.cardNumCtr,
          ),
        ),

        Container(
          margin: EdgeInsets.only(left: 18.w, top: 10.w, bottom: 10.w),
          child: const Text("预付卡密码"),
        ),

        Container(
          margin: EdgeInsets.only(left: 18.w,right: 18.w,bottom: 74.w),
          padding: EdgeInsets.only(left: 20.w,top: 10.w),
          color: Colors.white,
          height: 40.h,
          child: TextFormField(
            controller: controller.password,
            decoration: descript("请输入预付卡密码"),
          ),
        ),
        
        _Save()

      ],
    );
    });
  }

  /**
       * 按钮
       */
  Widget _Save() => Container(
        width: double.infinity,
        // height: 60.h,
        // color: Colors.white,
        padding: const EdgeInsets.all(18.0),
        child: ElevatedButton(
            style: ButtonStyle(
              backgroundColor:
                  MaterialStateProperty.all(const Color.fromRGBO(248, 63, 45, 1)),
            ),
            onPressed: () => {
              controller.add()
            },
            //自带的按钮有阴影，先暂时用到
            child: const Text(
              "确认",
              style: TextStyle(
                  fontSize: 14.0,
                  fontWeight: FontWeight.w500,
                  color: Colors.white),
            )),
      );
}
